package webServlets;

import domain.Account;
import service.AccountService;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class SignOutServlet extends HttpServlet {
    private static final String SIGN_OUT = "/WEB-INF/catalog/Main.jsp";
    private String username;
    private Account account;
    private AccountService accountService;

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        account = null;
        HttpSession session = request.getSession();
        session.setAttribute("account",account);

        request.getRequestDispatcher(SIGN_OUT).forward(request,response);
    }
}
